<?php

class Public_OpenIdLoginSuccessView extends BlogPublicBaseView
{
	public function executeHtml(AgaviRequestDataHolder $rd)
	{
		// We have to perform redirect
		$redirect = $this->getAttribute('openid_redirect');
		if (!is_null($redirect)) {
		    if (!is_null($this->getAttribute('openid_login_success'))) {
                $this->getContext()->getUser()->rememberSession();
		    }
		    $this->getResponse()->setRedirect($redirect);
		    return;
		}
		
		$html = $this->getAttribute('openid_html');
		if (is_null($html)) {
		    $this->setupHtml($rd);
		    $this->setAttribute('error', true);
		} else {
		    $this->setupHtml($rd, 'slot');
		}
		
		$this->setAttribute('title', 'OpenIdLogin');
	}
}

?>